const Router = require('koa-router');
const router = new Router();
const {db, QueryTypes, } = require('../../models/db')
const tools = require("../../tools/tool");
router.post('/design/getSearchRule', async ctx => {
    let obj = await tools.pageSets(ctx)
    let fields = tools.getFields(obj)
    let sear = {
        field: 'search', type: 'search', props: {
            rule: fields.searchFields
        },
        inject: true,
        on: {
            // tab改变
            changeTab: (inject, val) => {
                inject.$f.exec('grid', 'search')
            },
        }
    }
    return ctx.suc('suc', tools.obj2str(sear))
})




module.exports = router;
